<?php

function mail_utf8($to, $subject = '(No subject)', $message = '', $header = '') { 
  $header_ = 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/html; charset=UTF-8' . "\r\n"; 
  mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=', $message, $header_ . $header); 
} 

// multiple recipients
$to  = $_REQUEST['to'];
$from = $_REQUEST['from'];
$subject = $_REQUEST['subject'];

// message
$message = $_REQUEST['message'];

// To send HTML mail, the Content-type header must be set
 
// Additional headers
$headers = "To: $to" . "\r\n";
$headers .= "From: $from" . "\r\n";
$res = mail($to, $subject, $message , $headers);
 print "Message has been $res sent ---$message--- ***$to*** ===$from===\r\n";
?> 
